<?php

include_once($_SERVER['DOCUMENT_ROOT'] ."/include/user/inc.php");

error_reporting(E_ALL);


//所有的参数
$g_cgival 	= array();
//存储中间数据 非输出数据 可以不用
$g_pro	 	= array();
//要显示的数据 输出数据
$g_show 	= array();

function check_cgi_pro()
{		
	global $g_cgival, $g_pro, $g_show, $config;
	
	cgi::both($g_cgival["url"], "url", "");
	$g_cgival['url'] 	= string::un_html($g_cgival['url']);
	
	
}


function get_data()
{
	global $g_cgival, $g_pro, $g_show, $config;
	
	if(!$g_cgival['url'])
	{
		$g_cgival['url'] = "/index.php";
	}
	
	$g_show["url"] = $g_cgival['url'] ;
}

try {
	$g_show['error'] = 0;
	$g_show['errmsg'] = "";
	check_cgi_pro();
	get_data();
	
} catch (Exception $e) {
	$g_show['error'] = 1;
	$g_show['errmsg'] = $e->getMessage();
}

show_pro();


exit;

function show_pro()
{
	global $g_cgival, $g_pro, $g_show, $config;

	
	$smarty = p_get_smarty();	
	$smarty->assign("g_show", $g_show);
	if (isset($_GET["debug"]))
	{
		print_r($g_show);
	}
	if($g_show["error"])
	{
		
		$smarty->display("error.html");
	}
	else
	{
		$smarty->display("user/register.html");
	}
	
	unset($g_cgival);
	unset($g_pro);
	unset($g_show);
	unset($config);
}

